import Vue from 'vue';
const interceptors =require('../lib/axios_interceptors'); 
export default function ({$axios }) {
   
    $axios.onRequest((config) => {
        if( typeof document !="undefined"){
            Vue.prototype.$tools.showToast();
        }
        
         
      });
      $axios.onResponse((res) => {
        if( typeof document !="undefined"){
            Vue.prototype.$tools.hideToast();
        }
      });
      $axios.onError((error) => {
        if( typeof document !="undefined"){
            Vue.prototype.$tools.hideToast();
        }
        // return config;
      });
$axios.interceptors.response.use((response)=>interceptors.response(response),(error)=>interceptors.error(error))
}
